<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="author" content="yhofoodie" />
		<meta name="keywords" content="yhofoodie" />
		<meta name="description" content="yhofoodie" />
		<meta name="renderer" content="webkit" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1" name="viewport" />
		<title>yhofoodie</title>
		<link rel="stylesheet" href="../css/common.css?001" />
		<link rel="stylesheet" href="../css/templet.css?001" />
		<link rel="stylesheet" href="../fonts/font-awesome.min.css?001" />
		<link rel="stylesheet" href="../css/mui.min.css" />
		<!--页面内容部调用-->
		<style>
			.inp.required {
				margin: 0;
			}
		</style>
	</head>

	<body class="index">

		<!--最外层盒子-->
		<div class="wrap_body" id="bodyapp">
			<div class="login-img pad-t-20 pad-b-20">
				<img src="../img/logo_03.jpg" />
			</div>

			<div class="login-box pad-b-50 w80" id="login-box">
				<div class="item">
					<span class="icon f-16"><i class="fa fa-id-badge"></i></span>
					<div class="p fiex">
						<div class="p3 fiex5">
							<input class="inp required" value="" data-valid="isNonEmpty" v-model="froms.username" data-error="请输入账号" type="text" placeholder="请输入账号" />
						</div>
					</div>
				</div>
				<div class="item">
					<span class="icon f-16"><i class="fa fa-unlock-alt"></i></span>
					<div class="p fiex">
						<div class="fiex4"><input class="inp required" type="password" v-model="froms.password" value="" data-valid="isNonEmpty" data-error="请输入密码" placeholder="请输入密码" /></div>
						<div class="fiex4 f-right ">
							<a href="forget.html" class="c999">忘记密码?</a>
						</div>
					</div>
				</div>
				<div class="error-box pad-t-10 red" id="errortip">
					<span class="mag-r-5"></span>
				</div>
				<div class="mag-t-10 f-16">
					<a class="bon-yellow bk bon" v-on:click="sub_from">登录</a>
				</div>
				<div class="mag-t-20 f-16">
					<a href="reg.html" class="bon-yellow2 bk bon">注册</a>
				</div>
			</div>

			<div class="login-bottom center c666 f-12">
				<span class="mag-r-5"><i class="fa fa-exclamation-circle c999"></i></span>
			</div>

		</div>
		<script type="text/javascript" src="../js/jquery.js"></script>
		<script type="text/javascript" src="../js/ajax.js"></script>
		<script type="text/javascript" src="../js/main.js"></script>
		<script type="text/javascript" src="../js/vue.min.js"></script>
		<script type="text/javascript" src="../js/jquery-validate.js"></script>
		<script>
			//表单验证
			$('#login-box').validate({
				selectID: "#errortip" //指定弹出位置
			});

			//设置vue
			var app = new Vue({
				el: '#bodyapp',
				data: {
					froms: {
						username: "",
						password: ""
					}
				},
				methods: {
					sub_from: function() { //提交表单
						//通过验证
						if($("#login-box").validate('submitValidate')) {

							re_ajax("member_app_login", app.froms, "zh", function(h) {
								if(!h.status) {
									alert(h.msg);
								} else {
									alert("登录成功");
									localStorage.setItem("member_id", h.result.yingsoft_home_member_id);
									$(window).attr("location", "../Shop/Shop.html");
								}
							});

						}
					}
				}
			})
		</script>

	</body>

</html>